package com.kfm.src.Demo0922;

import java.sql.*;

public class DemoOne {
    /**
     * 创建表
     * 创建数据库
     *
     */
    public static void main(String[] args) {

        try {
            Class.forName("com.mysql.cj.jdbc.Driver");
        } catch (ClassNotFoundException e) {
            throw new RuntimeException(e);
        }
        // 获取连接
        String url = "jdbc:mysql://127.0.0.1:3306/kaifamiao";
        String user = "root";
        String pass = "";
        try {
            Connection connection = DriverManager.getConnection(url, user, pass);
            Statement statement = connection.createStatement();
            String sql = "CREATE TABLE student";
            statement.execute(sql);

            ResultSet resultSet = statement.getResultSet();
            System.out.println(resultSet);
        } catch (SQLException e) {
            throw new RuntimeException(e);
        }


    }
}
